﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BarStockManager.Model
{
    public class Coctail
    {
        public Coctail()
        {
            Ingridients = new Dictionary<Drink, float>();
        }
        public Coctail(string name)
        {
            Name = name;
            Ingridients = new Dictionary<Drink, float>();
        }

        public Guid Id { get; set; }
        public string Name { get; set; }
        public float Volume 
        {
            get
            {
                return Ingridients.Sum(ing => ing.Value);
            }
        }
        public Dictionary<Drink, float> Ingridients { get; set; }
        public float Margin { get; set; }
        public float Price
        {
            get
            {
                float price = Ingridients.Sum(ing => ing.Value * ing.Key.Price / ing.Key.Volume);
                return Margin * price;
            }
        }
    }
}
